#ifndef __API_H_
#define __API_H_

#include <devctl.h>
#include <inttypes.h>


#define MAX_N_PARAM 10
typedef struct {
	uint8_t	node_id;
	int		n_param;	
	uint8_t menu  [MAX_N_PARAM];
	uint8_t param [MAX_N_PARAM]; 
	double	data  [MAX_N_PARAM];
	int		ret_code;
} ctnet_data_t;


typedef struct {
	int		node_id;		// destination node id
	int		addr;			// start address
	int		code;			// memory code
	int		n_elem;			// num of elements
	int		ret_code;		// return code
	double	rdata;			// data in real format (double)
	short	data [255];		// data in int format (short)
	int		retry_max;		// maximum num of retries
} mem_data_t;

#define DCMD_READ_MEM			__DIOTF(_DCMD_MISC, 1, mem_data_t)
#define DCMD_WRITE_MEM			__DIOTF(_DCMD_MISC, 2, mem_data_t)
#define DCMD_READ_PAR			__DIOTF(_DCMD_MISC, 3, mem_data_t)
#define DCMD_WRITE_PAR			__DIOTF(_DCMD_MISC, 4, mem_data_t)

#define DCMD_READ_CTNET			__DIOTF(_DCMD_MISC, 10, ctnet_data_t)
#define DCMD_SNIF_CTNET			__DION (_DCMD_MISC, 11)

#define DCMD_GET_FTREND			__DIOT (_DCMD_MISC, 20, char)
#define DCMD_FREE_FTREND		__DIOT (_DCMD_MISC, 21, char)

#endif // __API_H_